<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>background</title>
	<script src="js/jquery.js"></script>
    <link href="js/bootstrap.min.css" rel="stylesheet">
    <link href="js/style.css" rel="stylesheet" type="text/css">
    <script src="js/bootstrap.min.js"></script>
</head>

<body style="margin:0;pading:0;">
<?php
include 'conn_mysql.php';
include 'sidebar.php';

include_once("function.php");

$bigtype=$_REQUEST['bigtype'];
if(strlen($bigtype)==0){
	$bigtype=1;
}
if($bigtype==1){
?>
<input type="button" style="float:right;width:80px;height:30px;border-radius:2px;background-color:#DA4713;color:#FFFFFF;font-family:微软雅黑;font-size:14px;border:1px #000;text-align:center; cursor:pointer;margin-top:20px;margin-right:10%;-webkit-appearance:none;" value="搜索" onclick="shoushuo();" ></input>
<input style="float:right;width:120px;height:30px;border-radius:2px;color:#000000;font-family:微软雅黑;font-size:14px;padding-left:13px;border:1px solid #C9CACA;margin-top:20px;margin-right:2%;" placeholder="电话搜索" id="phone_select"></input>
<SCRIPT LANGUAGE="javascript"> 
	function shoushuo(){
		phone_select=document.getElementById("phone_select").value;
		
		window.location.href='youke_info.php?phone_select='+phone_select;
	}
</SCRIPT>

<div style="clear:right;width:80%;height:40px;margin-left:200px;margin-top:5px;border-bottom:1.5px solid #C9C9CA;">	
	<div style="clear:right;float:left;width:8%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">序号</a></div>
	<div style="clear:right;float:left;width:15%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">姓名</a></div>
	<div style="clear:right;float:left;width:8%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">性别</a></div>
	<div style="clear:right;float:left;width:17%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">电话</a></div>
	<div style="clear:right;float:left;width:23%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">身份证</a></div>
	<div style="clear:right;float:left;width:12%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;">总驴币</a></div>
</div>
<?php
$pag=$_REQUEST['pag'];
$phone_select=$_REQUEST['phone_select'];

if(strlen($phone_select)==0){
	$sql="SELECT * FROM `ecs_users` where 1";
}else{
	$sql="SELECT * FROM `ecs_users` where mobile_phone like '%$phone_select%'";
}
$query = mysql_query($sql);
$num=mysql_num_rows($query);

if($pag>ceil($num/10)){
	$pag=ceil($num/10);
}
if($pag<1){
	$pag=1;
}

$pag_bigin=($pag-1)*10;

$i=1+$pag_bigin;
//跳转链接
$page_url="youke_info.php?info_type=3&phone_select=$phone_select";
/*分页*/
$page_list=get_html_page_list($pag,10,$num);

if(strlen($phone_select)==0){
	$sql="SELECT * FROM `ecs_users` where 1 order by user_id limit $pag_bigin,10";
}else{
	$sql="SELECT * FROM `ecs_users` where mobile_phone like '%$phone_select%' order by user_id limit $pag_bigin,10";
}
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
	if($row['sex']==0){
		$sex="保密";
	}
	if($row['sex']==1){
		$sex="男";
	}
	if($row['sex']==2){
		$sex="女";
	}
?>
	<div style="width:80%;height:40px;margin-left:200px;margin-top:5px;border-bottom:1px solid #C9C9CA;">	
		<div style="clear:right;float:left;width:8%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;"><?php echo $i;?></a></div>
		<div style="float:left;width:15%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;"><?php echo $row['user_name'];?></a></div>
		<div style="float:left;width:8%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;"><?php echo $sex;?></a></div>
		<div style="float:left;width:17%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;"><?php echo $row['mobile_phone'];?></a></div>
		<div style="float:left;width:23%;height:40px;line-height:40px;text-align:center;"><a style="color:#3E3A39;font-family:微软雅黑;font-size:14px;"><?php echo $row['shenfen_ID'];?></a></div>
		<div style="float:left;width:12%;height:40px;line-height:40px;text-align:center;">
			<a style="color:#DA4B3B;font-family:微软雅黑;font-size:14px;cursor:pointer;" title="点击查看该用户获取驴币历史" href="youke_info.php?bigtype=2&openid=<?php echo $row['openid'];?>" target="_blank">
				<?php echo $row['pay_points'];?>
			</a>
		</div>

		
	</div>
<?php	
$i++;}
?>

<div style="width:90%;height:35px;text-align:center;line-height:35px;margin-top:15px;margin-left: 50px;">
        	<a style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;text-decoration:none;cursor:pointer;" href="<?php echo  $page_url."&pag=".$page_list['first']['page']; ?>">首页</a>
			<a style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;text-decoration:none;cursor:pointer;" href="<?php echo  $page_url."&pag=".$page_list['front']['page']; ?>">上一页</a>
			<a style="display:inline;color:#3E3A39;font-family:微软雅黑;font-size:14px;margin-left:10px;"><</a>
			<?php
			foreach($page_list['list'] as $k_page=>$v_page){
				if($v_page['page']==$pag){
			?>
				<a style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;text-decoration:none;cursor:pointer;" href="<?php echo $page_url."&pag=".$v_page['page']; ?>"><?php echo $v_page['page'] ?></a>
				<?php }else{ ?>
				<a style="display:inline;color:#3E3A39;font-family:微软雅黑;font-size:14px;text-decoration:none;cursor:pointer;" href="<?php echo $page_url."&pag=".$v_page['page']; ?>"><?php echo $v_page['page'] ?></a>
				<?php }
				} ?>
                
			<a style="display:inline;color:#3E3A39;font-family:微软雅黑;font-size:14px;">></a><a style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;margin-left:10px;text-decoration:none;cursor:pointer;" href="<?php echo $page_url."&pag=".$page_list['after']['page'];  ?>">下一页</a>
            <a style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;text-decoration:none;cursor:pointer;" href="<?php echo $page_url."&pag=".$page_list['last']['page'];  ?>">尾页</a>
		     <span style="display:inline;color:#DA4B3B;font-family:微软雅黑;font-size:14px;margin-left:10px;text-decoration:none;cursor:pointer;" href="javascript:void(0)">总计<?php echo $page_list['last']['page']; ?>页</span>
        </div>
<?php }

if($bigtype==2){
	$openid=$_REQUEST['openid'];
	//查询该用户获取驴币途径
	$sql="SELECT * FROM `lvbi_huoqv` WHERE openid='$openid'";
	$query = mysql_query($sql);
	while($row = mysql_fetch_array($query)){
?>

		<a style="text-align:center"><?php echo $row['huoqv_tujing']." ".$row['how_much']."驴币</br>";?></a>

<?php	
	}
?>


<?php	
}
?>


<script type="text/javascript">
window.onload=function(){
	clientWidth=document.body.clientWidth;//屏幕宽
	clientHeight=window.screen.availHeight;//屏幕高
}
function del(id_self){
	if (confirm("是否确认删除该客户")){  
		var url="getmessage_all.php?bigtype=2";
		url=url+"&id_self="+id_self;
		
		$.ajax({
			type:"GET",
			url:url,
			dataType: "json",
			success: function(data){	
				if(data['code']==0001){
					location.reload([true]);
				}
			}
		});
	}
}

</script>
</body>








